package com.cipe.cmrs.service;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cipe.cmrs.model.Solomon;

@Service
@Transactional
public class SolomonService extends BaseService<Solomon> {

	public Solomon getSolomonDataByCostCenterNumber(String costcenternumber) {
		Solomon solomon = new Solomon();
		solomon = this.dao
				.getSingleResult("from Solomon s where s.costcenternumber='"
						+ costcenternumber + "'");
		if (solomon == null) {
			solomon = new Solomon();
			solomon.setAc6010(0);
			BigDecimal total = new BigDecimal(0);
			solomon.setTotalAmount(total);
			solomon.setDate(null);
		}

		return solomon;
	}
}
